const CODE_SUCCESS = 1
const CODE_FAILURE = 0
const CODE_NO_AUTH = 50001


module.exports = {
    CODE_SUCCESS,
    CODE_FAILURE,
    CODE_NO_AUTH,
    model(code, message, data) {
        return {
            code: code,
            message: message,
            data: data
        }
    },
    success(data, message=''){
        return {
            code: CODE_SUCCESS,
            message: message,
            data: data
        }
    },
    failure(message){
        return {
            code: CODE_FAILURE,
            message: message?message:'failure',
            data: null
        }
    }
}